package ro.flashbite.game_engine.interfaces
{
	import ro.flashbite.game_engine.data.intefaces.IAppDataStorage;

	/**
	 * Interface defining interaction between each level with externals (LevelManager and GameEngine)
	 * 
	 * v 1.0
	 *  
	 * @author Adrian Barbu
	 */	
	public interface ILevelToEngine
	{
		// callbacks in MenuManager
		function setLevelInitComplete(id:String):void
		
		// global callbacks to gameEngine
		function openPauseLevelMenu(id:String = null):void;
		function openCompleteGameMenu(id:String = null, data:* = null):void;
		function openCompleteLevelMenu(id:String = null, data:* = null):void;
		function openGameOverLevelMenu(id:String = null, data:* = null):void;
		
		// IGameEngine functions
			//asset manager getting data
		function getLevelAssetContent(id:String, type:String):Object; //XML, Bitmap, MovieClip
		function getGlobalAssetContent(id:String, type:String):Object;
			//sound play/stop management
		function playSound(ids:Array, closure:Function = null, loops:int = 1):Boolean;
		function playSoundNoOverwrite(ids:Array, closure:Function = null, loops:int = 1):Boolean;
		function stopSound(ids:Array):void;
		function stopAllSounds():void;
		function getSoundLength(soundID:String):Number;
			//global saving data
		function saveSharedData(id:String, data:Object, overwrite:Boolean = true):void;
		function getSharedData(id:String):Object;
			//global application storage
		function getAppDataStorage():IAppDataStorage;
		function saveAppDataStorage():void;
			//console callbacks
		function addConsoleBinding(bindingID:String, bindingFunction:Function, bindingParam:Array = null, overwriteSame:Boolean = true):void;
		function removeConsoleBinding(bindingID:String):void;
	}
}